package display;
import javax.swing.JApplet;
import javax.swing.JButton;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextArea;

import fuzzy.FuzzyEngine;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class Lines extends JApplet implements ActionListener {

  private static final long serialVersionUID = 1L;
   
  public void init() {      
    
    /*JPanel contentPane = new JPanel();  
    contentPane.setLayout(new FlowLayout());  

    Panel panel1 = new Panel();  
    contentPane.add(panel1,FlowLayout.LEFT);
    panel1.add(new JButton("OK!"));    
    
    Panel panel2 = new Panel();  
    contentPane.add(panel2,FlowLayout.CENTER);
    panel1.add(new JTextArea());   
    
    setContentPane(contentPane);   // essential to make this work!
        
    setVisible(true); 
    setSize(1000,500); */
	  
    double velocity = Double.parseDouble(JOptionPane.showInputDialog ( "Please enter desired Velocity." ));  
    double distance = Double.parseDouble(JOptionPane.showInputDialog ( "Please enter desired Distance." )); 
    
    FuzzyEngine fEngine = new FuzzyEngine(velocity, distance);
    
    double currentVelocity = Double.parseDouble(JOptionPane.showInputDialog ( "Please enter current Velocity." ));  
    double currentDistance = Double.parseDouble(JOptionPane.showInputDialog ( "Please enter current Distance." )); 
    fEngine.testRules(currentVelocity, currentDistance);
    
  }
  
  public void actionPerformed(ActionEvent event) {  

  } 

  public void paint(Graphics g) {

  }
}